﻿<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<z.m.db.Order>" %>

<fieldset>
	<legend>Order</legend>
	<%using (Html.BeginForm("_Edit", "Order", FormMethod.Post)) { %>
	<table style="margin: 0 auto;">
		<thead>
			<tr>
				<td><%:Html.LabelFor(m=>m.ID)%></td>
				<td><%:Html.TextBoxFor(m => m.ID, new { @readonly = true })%></td>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td><%:Html.LabelFor(m=>m.Create_Date) %></td>
				<td>
					<%:Html.TextBoxFor(m => m.Create_Date, "{0:yyy-MM-ddTHH:mm}", new {@type="datetime-local",@readonly="true" })%>
					<%:Html.ValidationMessageFor(m=>m.Create_Date) %>
				</td>
			</tr>
			<tr>
				<td><%:Html.LabelFor(m=>m.Order_Date) %></td>
				<td>
					<%:Html.TextBoxFor(m => m.Order_Date, "{0:yyy-MM-ddTHH:mm}", new {@type="datetime-local"})%>
					<%:Html.ValidationMessageFor(m=>m.Order_Date) %>
				</td>
			</tr>
			<tr>
				<td><%:Html.LabelFor(m=>m.Address) %></td>
				<td>
					<%:Html.TextAreaFor(m=>m.Address) %>
					<%:Html.ValidationMessageFor(m=>m.Address) %>
				</td>
			</tr>
			<%--<tr>
				<td><%:Html.LabelFor(m=>m) %></td>
				<td>
					<%:Html.DisplayFor(m=>m) %>
					<%:Html.ValidationMessageFor(m=>m) %>
				</td>
			</tr>--%>
			<tr>
				<td><%:Html.LabelFor(m=>m.Create_Date) %></td>
				<td>
					<div class="hidden" data-col="Messenger">
						<div class="close" onclick="closePopup(this.parentElement);destroyEditor();"></div>
						<br />
						<textarea name="Messenger"><%:Model.Messenger %></textarea>
					</div>
					<input
						class="<%:ViewData.ModelState.Keys.Contains("Messenger")?"input-validation-error":"" %>"
						value="Messenger" type="button" onclick="showPopup('div[data-col=\'Messenger\']'); installEditor('div[data-col=\'Messenger\']');" />
					<div class="hidden" data-col="MessengerDialog">
						<div class="close" onclick="closePopup(this.parentElement);"></div>
						<%:Html.Partial("~/Views/Messenger/Dialog.aspx",Model.Occasion.Messengers.ToList()) %>
					</div>
					<input type="button" value="Choose from Predefined Messages" onclick="showPopup('div[data-col=\'MessengerDialog\']');" />
					<%:Html.ValidationMessageFor(m=>m.Messenger) %>
				</td>
			</tr>
			<tr>
				<td><%:Html.LabelFor(m=>m.Note) %></td>
				<td>
					<%:Html.TextAreaFor(m=>m.Note) %>
					<%:Html.ValidationMessageFor(m=>m.Note) %>
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr>
				<td colspan="99">
					<input type="submit" value="Save" style="width: 100%;" />
				</td>
			</tr>
		</tfoot>
	</table>
	<%} %>
	<fieldset>
		<legend>Order Detail</legend>
		<%:Html.Partial("~/Views/Order_Detail/_Table.aspx",viewData:ViewData) %>
	</fieldset>
</fieldset>
